import request from "@/axios/request"
import url from "@/axios/url"
const { wmsUrl, adminUrl ,mesUrl} = url()
// 导出url
export const exportUrl = `${wmsUrl}wmsOrderCheckDiff/export`
// 分页查询
export function getList(params = {}) {
  return request({
    url: `${mesUrl}mesOrderCheckDiff`,
    method: "get",
    params
  })
}
// 新增
export function rowCreate(data = {}) {
  return request({
    url: `${wmsUrl}wmsOrderCheckDiff`,
    method: "post",
    data
  })
}
// 修改
export function rowUpdate(data = {}) {
  return request({
    url: `${wmsUrl}wmsOrderCheckDiff`,
    method: "put",
    data
  })
}
// 删除
export function rowDel(id) {
  return request({
    url: `${wmsUrl}wmsOrderCheckDiff/${id}`,
    method: "put"
  })
}
// 详情
export function rowDetail(id) {
  return request({
    url: `${wmsUrl}wmsOrderCheckDiff/info/${id}`,
    method: "get"
  })
}

// 导入用户
export function importData(data = {}) {
  return request({
    url: `${wmsUrl}wmsOrderCheckDiff/import`,
    method: "POST",
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  })
}
// 下载模板
export const downloadTemplateUrl = `${wmsUrl}wmsOrderCheckDiff/template`

// 查询差异状态列表
export function getDiffStatusList() {
  return request({
    url: `${adminUrl}dict/type/wms_diff_status`,
    method: "get"
  })
}
// 查询是否扫描列表
export function getScanFlagList() {
  return request({
    url: `${adminUrl}dict/type/active_flag`,
    method: "get"
  })
}
// 查询是否关闭列表
export function getCloseFlagList() {
  return request({
    url: `${adminUrl}dict/type/active_flag`,
    method: "get"
  })
}
// 查询差异原因类型列表
export function getDiffTypeList() {
  return request({
    url: `${adminUrl}dict/type/wms_diff_type`,
    method: "get"
  })
}

// 差异处理
export function handleDiff(data = {}) {
  return request({
    url: `${mesUrl}mesOrderCheckDiff/handle`,
    method: "post",
    data
  })
}
